<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

//Route::get('api/user/login', 'index/index');
Route::group('api',function (){
    //初始化首页
    Route::get('/','index/index');
    //用户模块
    Route::group('user',function (){
        Route::post('login','user/login');
        Route::post('register','user/register');
        Route::post('index','user/index')->middleware('authorized');
        Route::post('like','user/like')->middleware('authorized');
        Route::post('complete','user/complete');
        Route::post('edit','user/edit')->middleware('authorized');
        Route::post('logout','user/logout')->middleware('authorized');
        Route::post('logoff','user/logoff')->middleware('authorized');
        Route::post('avatar','user/avatar')->middleware('authorized');
    });

    //商户模块
    Route::group('merchant',function (){
        Route::post('index','merchant/index');
        Route::post('my','merchant/my')->middleware('authorized');
        Route::post('login','merchant/login');
        Route::post('logout','merchant/logout')->middleware('authorized');
        Route::post('logoff','merchant/logoff')->middleware('authorized');
        Route::post('register','merchant/register');
        Route::post('edit','merchant/edit')->middleware('authorized');
        //他人帖子列表
        Route::post('lists','merchant/lists');
        Route::post('myPosts','merchant/myPosts')->middleware('authorized');
        Route::post('myLike','merchant/myLike')->middleware('authorized');
        Route::post('avatar','merchant/avatar')->middleware('authorized');
    });


    //首页模块
    Route::group('index',function (){
        Route::post('merchant/posts','index/merchantPosts');
        Route::post('merchant/merchant','index/merchantMerchants');
        Route::post('user/posts','index/userPosts');
        Route::post('user/merchant','index/userMerchants');
        Route::post('completion','index/completion');
        Route::post('merchant/airport','index/getAirport');
        Route::post('user/airport','index/getAirport2');
    });

    //帖子模块
    Route::group('posts',function (){
        Route::post('info','posts/info');
        Route::post('add','posts/add')->middleware('authorized');
        Route::post('edit','posts/edit')->middleware('authorized');
        Route::post('delete','posts/delete')->middleware('authorized');
        Route::post('like','posts/like')->middleware('authorized');
    });
    Route::post('refresh','tool/refresh_token');
    Route::post('modifyPhone','tool/modify_phone')->middleware('authorized');
    Route::post('modifyEmail','tool/modify_email')->middleware('authorized');
    Route::post('sendEmail','tool/send_email');
    Route::post('modifyPassword','tool/modify_password')->middleware('authorized');
    Route::post('checkCode','tool/check_code');
    Route::post('upload','tool/upload');
    Route::post('uploads','tool/uploads');
    Route::post('countries','tool/countries');
    Route::post('airports','tool/airports');
    Route::post('categories','tool/categories');
    Route::post('labels','tool/labels');
    Route::post('materials','tool/materials');
    Route::post('phoneCode','tool/phone_code');
    Route::post('sendSms','tool/sendSms');
    Route::post('system','tool/system');
    Route::post('content','tool/content');
    Route::post('qrcode','tool/qrCode');
    Route::post('handleCode','tool/handleCode');
    Route::post('getCode','tool/getCode');

})->middleware('signature');

return [

];